package io.school;

import java.io.*;

/**
 * @author haomin
 * @date 2022/06/13 15:27
 **/
public class srcRootDir {
    public static void main(String[] args) throws IOException {
        // 初始化
        File src = new File("C:\\Users\\86187\\IdeaProjects\\javaEE_learn\\src\\io\\school\\srt.java");
        InputStream is = new FileInputStream(src);
        Reader reader = new InputStreamReader(is);

        for (int i = 1; i <= 34; i++) {
            File file = new File("C:\\Users\\86187\\IdeaProjects\\javaEE_learn\\src\\io\\school\\srcRootDirectory\\chapter" + i);
            file.mkdirs();

            File file1 = new File("C:\\Users\\86187\\IdeaProjects\\javaEE_learn\\src\\io\\school\\srcRootDirectory\\chapter" + i + "\\test.java");
            OutputStream os = new FileOutputStream(file1);
            Writer writer = new OutputStreamWriter(os);
            int num;
            while ((num = reader.read()) != -1){
                writer.write((char)num);
            }
        }


    }
}